package com.hospital.hospitalserver.controller;

import com.hospital.hospitalserver.entity.PharmacistDetail;
import com.hospital.hospitalserver.entity.Vo.Pharmacist;
import com.hospital.hospitalserver.service.PharmacistService;
import com.hospital.hospitalserver.service.ProfessionService;
import com.hospital.hospitalserver.util.Pager;
import com.hospital.hospitalserver.util.Response;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

/**
 * 药剂师控制器API接口
 * */
@CrossOrigin
@RestController
@RequiredArgsConstructor
@RequestMapping("/pharmacist")
public class PharmacistController {
    private final ProfessionService professionService;
    private final PharmacistService pharmacistService;

    /**
     * 获取药剂师职称信息列表
     * */
    @GetMapping("/getPharmacistProfessionList")
    public Response getPharmacistProfessionList(){
        return professionService.getPharmacistProfessionList();
    }



    /**
     * 添加药剂师
     * */
    @PostMapping("/addPharmacist")
    public Response addPharmacist(@RequestBody PharmacistDetail pharmacist){
        return pharmacistService.addPharmacist(pharmacist);
    }

    /**
     * 编辑药剂师
     * */
    @PostMapping("/editPharmacist")
    public Response editPharmacist(@RequestBody PharmacistDetail pharmacist){
        return pharmacistService.editPharmacist(pharmacist);
    }


    /**
     * 状态药剂师分页数据API
     * */
    @PostMapping("/getPharmacistPagerDataBySearch")
    public Response getPharmacistPagerDataBySearch(@RequestBody Pager pager){
        return pharmacistService.getPharmacistPagerDataBySearch(pager);
    }

    /**
     * 获取药剂师列表数据用于排班模板
     * */
    @GetMapping("/getPharmacistList")
    public Response getPharmacistList(){
        return pharmacistService.getPharmacistList();
    }

}
